<h3><a href="{$action_link.href}" class="actionBtn">{$action_link.text}</a>小程序导航</h3>
<!-- {if $act eq 'default'} 导航列表 -->
<table width="100%" border="0" cellpadding="10" cellspacing="0" class="tableBasic">
    <tr>
        <th width="113" align="center">{$lang.nav_name}</th>
        <th align="left">导航图标</th>
        <th width="80" align="center">{$lang.sort}</th>
        <th width="120" align="center">{$lang.handler}</th>
    </tr>
    <!-- {foreach from=$nav_list item=nav_list} -->
    <tr>
        <td>{$nav_list.mark} {$nav_list.nav_name}</td>
        <td><img src="{$site.root_url}{$nav_list.image}" style="width: 50px;height: 50px"/></td>
        <td align="center">{$nav_list.sort}</td>
        <td align="center"><a href="wxapp.php?rec=footer_nav&act=edit&id={$nav_list.id}">{$lang.edit}</a> | <a href="wxapp.php?rec=footer_nav&act=del&id={$nav_list.id}">{$lang.del}</a></td>
    </tr>
    <!-- {/foreach} -->
</table>
<!-- {/if} -->
<!-- {if $act eq 'add'} 导航添加 -->
<script type="text/javascript">
    {literal}
    $(function(){ $(".idTabs").idTabs(); });
    {/literal}
</script>
<div class="idTabs">
    <ul class="tab">
        <li><a href="#nav_add">{$lang.nav_inside}</a></li>
        <li><a href="#nav_defined">功能菜单</a></li>
    </ul>
    <div class="items">
        <div id="nav_add">
            <form action="wxapp.php?rec=footer_nav&act=insert" method="post" enctype="multipart/form-data">
                <table width="100%" border="0" cellpadding="5" cellspacing="1" class="tableBasic">
                    <tr>
                        <td width="80" height="35" align="right">{$lang.nav_system}</td>
                        <td>
                            <select name="nav_menu" onchange="change('nav_name', this)">
                                <option value="">{$lang.nav_menu}</option>
                                <option value="index,0" {if $nav_info.module eq 'index'}selected{/if}>首页</option>
                                <!-- {foreach from=$catalog item=catalog} -->
                                <option value="{$catalog.module},{$catalog.guide}"{if $catalog.cur} selected="selected"{/if} title="{$catalog.name}">{$catalog.mark} {$catalog.name}</option>
                                <!-- {/foreach} -->
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td width="80" height="35" align="right">{$lang.nav_name}</td>
                        <td>
                            <input type="text" id="nav_name" name="nav_name" value="" size="40" class="inpMain" />
                        </td>
                    </tr>
                    <tr>
                        <td height="35" align="right">导航图标</td>
                        <td>
                            <input type="file" name="image"  size="5" class="inpMain" />
                        </td>
                    </tr>

                    <tr>
                        <td height="35" align="right">{$lang.sort}</td>
                        <td>
                            <input type="text" name="sort" value="50" size="5" class="inpMain" />
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <input type="hidden" name="token" value="{$token}" />
                            <input name="submit" class="btn" type="submit" value="{$lang.btn_submit}" />
                        </td>
                    </tr>
                </table>
            </form>
        </div>

        <div id="nav_defined">
            <form action="wxapp.php?rec=footer_nav&act=insert" method="post" enctype="multipart/form-data">
                <table width="100%" border="0" cellpadding="5" cellspacing="1" class="tableBasic">
                    <tr>
                        <td width="80" height="35" align="right">{$lang.nav_name}</td>
                        <td>
                            <input type="text" name="nav_name" value="" size="40" class="inpMain" />
                        </td>
                    </tr>

                    <tr>
                        <td height="35" align="right">导航功能</td>
                        <td>
                            <select name="nav_menu">
                                <option value="">请选择导航功能</option>
                                <option value="nav,tel">拨打电话</option>
                                <option value="nav,map">地图导航</option>
                                <option value="nav,contact">客服聊天</option>
                                <option value="nav,webview">webview</option>
                                <option value="nav,path">小程序路径</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td height="35" align="right">{$lang.nav_link}</td>
                        <td>
                            <input type="text" name="guide" value="" size="80" class="inpMain" />
                            <p class="cue">仅在webview或小程序路径的时候有效</p>
                        </td>
                    </tr>
                    <tr>
                        <td height="35" align="right">导航图标</td>
                        <td>
                            <input type="file" name="image"  size="5" class="inpMain" />
                        </td>
                    </tr>
                    <tr>
                        <td height="35" align="right">{$lang.sort}</td>
                        <td>
                            <input type="text" name="sort" value="50" size="5" class="inpMain" />
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <input type="hidden" name="token" value="{$token}" />
                            <input name="submit" class="btn" type="submit" value="{$lang.btn_submit}" />
                        </td>
                    </tr>
                </table>
            </form>
        </div>

    </div>
</div>
<!-- {/if} -->
<!-- {if $act eq 'edit'} 导航编辑 -->
<form action="wxapp.php?rec=footer_nav&act=update" method="post" enctype="multipart/form-data">
    <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
        <tr>
            <th colspan="2">&nbsp;</th>
        </tr>
        <!-- {if $nav_info.module neq 'nav'} -->
        <tr>
            <td width="80" height="35" align="right">{$lang.nav_system}</td>
            <td>
                <select name="nav_menu" onchange="change('nav_name', this)">
                    <option value="">{$lang.nav_menu}</option>
                    <option value="index,0" {if $nav_info.module eq 'index'}selected{/if}>首页</option>
                    <!-- {foreach from=$catalog item=catalog} -->
                    <option value="{$catalog.module},{$catalog.guide}"{if $catalog.cur} selected="selected"{/if} title="{$catalog.name}">{$catalog.mark} {$catalog.name}</option>
                    <!-- {/foreach} -->
                </select>
            </td>
        </tr>
        {else}
        <tr>
            <td height="35" align="right">导航功能</td>
            <td>
                <select name="nav_menu">
                    <option value="">请选择导航功能</option>
                    <option value="nav,tel" {if $nav_info.guide eq 'tel'}selected{/if}>拨打电话</option>
                    <option value="nav,map" {if $nav_info.guide eq 'map'}selected{/if}>地图导航</option>
                    <option value="nav,contact" {if $nav_info.guide eq 'contact'}selected{/if}>客服聊天</option>
                    <option value="nav,webview" {if $nav_info.guide eq 'webview'}selected{/if}>webview</option>
                    <option value="nav,path" {if $nav_info.guide eq 'path'}selected{/if}>小程序路径</option>
                </select>
            </td>
        </tr>
        <!-- {/if} -->
        {if $nav_info.guide eq 'webview' or $nav_info.guide eq 'path'}
        <tr>
            <td height="35" align="right">{$lang.nav_link}</td>
            <td>
                <input type="text" name="guide" value="{$nav_info.web}" size="80" class="inpMain" />
                <p class="cue">仅在webview或小程序路径的时候有效</p>
            </td>
        </tr>
        {/if}
        <tr>
            <td width="80" height="35" align="right">{$lang.nav_name}</td>
            <td>
                <input type="text" id="nav_name" name="nav_name" value="{$nav_info.nav_name}" size="40" class="inpMain" />
            </td>
        </tr>

        <tr>
            <td height="35" align="right">导航图标</td>
            <td>
                <input type="file" name="image"  size="5" class="inpMain" />
                {if $nav_info.image}<a href="../{$nav_info.image}" target="_blank"><img src="images/icon_yes.png"></a>{else}<img src="images/icon_no.png">{/if}
            </td>
        </tr>

        <tr>
            <td height="35" align="right">{$lang.sort}</td>
            <td>
                <input type="text" name="sort" value="{if $nav_info.sort}{$nav_info.sort}{else}50{/if}" size="5" class="inpMain" />
            </td>
        </tr>
        <tr>
            <td></td>
            <td>
                <input type="hidden" name="token" value="{$token}" />
                <input type="hidden" name="id" value="{$nav_info.id}" />
                <input name="submit" class="btn" type="submit" value="{$lang.btn_submit}" />
            </td>
        </tr>
    </table>
</form>
<!-- {/if} -->
